#include <iostream>

using namespace std;

#include <avstudyConfig.h>

#include <OggAnalyzer.h>
//#include <WGSMPlayer.h>
#include <AudioMixer.h>
#include <G711Codec.h>

#include <InterviewTest.h>
#include <map>
#include <functional>

using namespace std;


static map<string, function<int(int, char *[])>> projects = {
        {"testOggAnalyzer",   testOggAnalyzer},
//            {"G711Codec", testG711Codec},
//            {"testWGSMPlayer", testWGSMPlayer},
//            {"testWGSMPlayer", testWGSMPlayer},
        {"testInterviewTest", testInterviewTest},
        {"testOggAnalyzer",   testOggAnalyzer},
};


int main(int argc, char *argv[]) {
    if (argc < 2) {
        // report version
        cout << argv[0] << " Version " << avstudy_VERSION_MAJOR << "." << avstudy_VERSION_MINOR << "."
             << avstudy_VERSION_PATCH << endl;
        cout << "Usage: " << argv[0] << "subproject" << endl;
        return 1;
    }

    auto p = projects.find(argv[1]);
    if(p == projects.cend()){
        logError("Project %s doesn't registered.", argv[1]);
        return -1;
    }
    return p->second(argc, argv);
}

